human-in-the-loop pattern